package de.cbf.cam.dsa.tavern.carte.model.persistence.interfaces;

import java.awt.event.ActionListener;
import java.util.Collection;

import org.eclipse.swt.widgets.Composite;

public interface IPersister {
	
	public void config();
	
	public String getName();
	
	public void setViewParent(Composite parent);
	
	public void 				saveEntityObjects	();
	public void 				loadEntityObjects	();
	public Collection<Object> 	getEntityObjects	();	
	public void 				setEntityObjects	(Collection<? extends Object> values);
	
	public boolean hasUnsavedChanges();
	/**
	 * registered listener can use ActionEvent.getActionCommand as source of errorMessage
	 * @param listener
	 * @return
	 */
	public boolean registerExceptionListener(ActionListener listener);	
	public boolean deRegisterExceptionListener(ActionListener listener);
	
	public boolean registerObjectsChangedListener(ActionListener listener);	
	public boolean deRegisterObjectsChangedListener(ActionListener listener);
	
	public boolean registerSaveCompletedListener(ActionListener listener);
	public boolean deRegisterSaveCompletedListener(ActionListener listener);
	
	public boolean registerLoadCompletedListener(ActionListener listener);
	public boolean deRegisterLoadCompletedListener(ActionListener listener);
	
}
